﻿@model PmpNetwork.ViewModels.WikiAdminViewModel
@{    
    Script.Require("jQuery").AtHead();
    Script.Require("ShapesBase");

}
<div class="manage">
    <a class="button primaryAction" href="@Url.Action("Create", "WikiAdmin")">@T("Create New Article")</a>
</div>
@using (Html.BeginForm("Index", "WikiAdmin", FormMethod.Get))
{
    <fieldset class="bulk-actions">
        <label for="search">@T("Search:")</label>
        @Html.TextBoxFor(m => m.Search.Expression)
        <button type="submit">@T("Search")</button>
        <a href="@Url.Action("Index")">@T("Clear")</a>
    </fieldset>
}
@if (Model.Articles != null && Model.Articles.Count > 0)
{
<fieldset>
    <legend>@T("This is a table of the wiki articles in your application")</legend>
    <table class="items" summary="@T("This is a table of the wiki articles in your application")">
        <colgroup>
            <col id="Col1" />
            <col id="Col2" />
            <col id="Col3" />
            <col id="Col4" />
            <col id="Col5" />
            <col id="Col6" />
        </colgroup>
        <thead>
            <tr>
                <th scope="col">&nbsp;&darr;</th>
                <th scope="col">@T("Name")</th>
                <th scope="col">@T("Created Date")</th>
                <th scope="col">@T("Last Updated Date")</th>
                <th scope="col">@T("Total Views")</th>
                <th scope="col">@T("Actions")</th>
            </tr>
        </thead>
        @foreach (var article in Model.Articles)
        {
        <tr>
            <td>@article.Id</td>
            <td><a href="@Url.Action("Index", "Wiki", new {name = article.NameOnUrl})">@article.Name</a></td>
            <td>@article.CreatedDate</td>
            <td>@article.LastUpdatedDate</td>
            <td>@article.TotalViews</td>
            <td>
                <div>
                    <a href="@Url.Action("Edit", "WikiAdmin", new {article.Id})" title="@T("Edit")">@T("Edit")</a>@T(" | ")
                    <a href="@Url.Action("Questions", "WikiAdmin", new {article.Id})" title="@T("Questions")">@T("Questions")</a>@T(" | ")
                    <a href="@Url.Action("Delete", "WikiAdmin", new {article.Id, returnUrl = Request.Url.PathAndQuery})">@T("Delete")</a>
                </div>
            </td>
        </tr>
        } 
    </table>
    @Display(Model.Pager)
</fieldset>
}